package com.aaa.entity;

import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

public class GoodsQuery {
    private String goodsName;
    private Double starretailPrice;
    private Double endretailPrice;

    private Integer categoryId;
    private Integer goodsSizeId;
    @DateTimeFormat(pattern="yyyy-MM-dd")
    private Date startDate;
    @DateTimeFormat(pattern="yyyy-MM-dd")
    private Date endDate;

    public String getGoodsName() {
        if(goodsName!=null && !"".equals(goodsName)){
            return "%"+goodsName+"%";
        }

        return goodsName;
    }

    public void setGoodsName(String goodsName) {
        this.goodsName = goodsName;
    }

    public Double getStarretailPrice() {
        return starretailPrice;
    }

    public void setStarretailPrice(Double starretailPrice) {
        this.starretailPrice = starretailPrice;
    }

    public Double getEndretailPrice() {
        return endretailPrice;
    }

    public void setEndretailPrice(Double endretailPrice) {
        this.endretailPrice = endretailPrice;
    }

    public Integer getCategoryId() {
        return categoryId;
    }

    public void setCategoryId(Integer categoryId) {
        this.categoryId = categoryId;
    }

    public Integer getGoodsSizeId() {
        return goodsSizeId;
    }

    public void setGoodsSizeId(Integer goodsSizeId) {
        this.goodsSizeId = goodsSizeId;
    }

    public Date getStartDate() {
        return startDate;
    }

    public void setStartDate(Date startDate) {
        this.startDate = startDate;
    }

    public Date getEndDate() {
        return endDate;
    }

    public void setEndDate(Date endDate) {
        this.endDate = endDate;
    }

    @Override
    public String toString() {
        return "GoodsQuery{" +
                "goodsName='" + goodsName + '\'' +
                ", starretailPrice=" + starretailPrice +
                ", endretailPrice=" + endretailPrice +
                ", categoryId=" + categoryId +
                ", goodsSizeId=" + goodsSizeId +
                ", startDate=" + startDate +
                ", endDate=" + endDate +
                '}';
    }
}
